import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_task_process_nodes_entity.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_task_instructions_entity.dart';


EmergencyTaskProcessNodesEntity $EmergencyTaskProcessNodesEntityFromJson(Map<String, dynamic> json) {
  final EmergencyTaskProcessNodesEntity emergencyTaskProcessNodesEntity = EmergencyTaskProcessNodesEntity();
  final String? appRoutingAddress = jsonConvert.convert<String>(json['appRoutingAddress']);
  if (appRoutingAddress != null) {
    emergencyTaskProcessNodesEntity.appRoutingAddress = appRoutingAddress;
  }
  final String? businessId = jsonConvert.convert<String>(json['businessId']);
  if (businessId != null) {
    emergencyTaskProcessNodesEntity.businessId = businessId;
  }
  final int? childrenControlType = jsonConvert.convert<int>(json['childrenControlType']);
  if (childrenControlType != null) {
    emergencyTaskProcessNodesEntity.childrenControlType = childrenControlType;
  }
  final String? circulationAttribute = jsonConvert.convert<String>(json['circulationAttribute']);
  if (circulationAttribute != null) {
    emergencyTaskProcessNodesEntity.circulationAttribute = circulationAttribute;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyTaskProcessNodesEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyTaskProcessNodesEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyTaskProcessNodesEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyTaskProcessNodesEntity.deleted = deleted;
  }
  final int? disposalType = jsonConvert.convert<int>(json['disposalType']);
  if (disposalType != null) {
    emergencyTaskProcessNodesEntity.disposalType = disposalType;
  }
  final List<EmergencyTaskInstructionsEntity>? emergencyTaskInstructions = (json['emergencyTaskInstructions'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<EmergencyTaskInstructionsEntity>(e) as EmergencyTaskInstructionsEntity).toList();
  if (emergencyTaskInstructions != null) {
    emergencyTaskProcessNodesEntity.emergencyTaskInstructions = emergencyTaskInstructions;
  }
  final String? formId = jsonConvert.convert<String>(json['formId']);
  if (formId != null) {
    emergencyTaskProcessNodesEntity.formId = formId;
  }
  final String? iconAddress = jsonConvert.convert<String>(json['iconAddress']);
  if (iconAddress != null) {
    emergencyTaskProcessNodesEntity.iconAddress = iconAddress;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyTaskProcessNodesEntity.id = id;
  }
  final String? nodeDescription = jsonConvert.convert<String>(json['nodeDescription']);
  if (nodeDescription != null) {
    emergencyTaskProcessNodesEntity.nodeDescription = nodeDescription;
  }
  final String? nodeId = jsonConvert.convert<String>(json['nodeId']);
  if (nodeId != null) {
    emergencyTaskProcessNodesEntity.nodeId = nodeId;
  }
  final String? nodeName = jsonConvert.convert<String>(json['nodeName']);
  if (nodeName != null) {
    emergencyTaskProcessNodesEntity.nodeName = nodeName;
  }
  final String? nodeNumber = jsonConvert.convert<String>(json['nodeNumber']);
  if (nodeNumber != null) {
    emergencyTaskProcessNodesEntity.nodeNumber = nodeNumber;
  }
  final int? nodeType = jsonConvert.convert<int>(json['nodeType']);
  if (nodeType != null) {
    emergencyTaskProcessNodesEntity.nodeType = nodeType;
  }
  final int? parentControlType = jsonConvert.convert<int>(json['parentControlType']);
  if (parentControlType != null) {
    emergencyTaskProcessNodesEntity.parentControlType = parentControlType;
  }
  final String? pid = jsonConvert.convert<String>(json['pid']);
  if (pid != null) {
    emergencyTaskProcessNodesEntity.pid = pid;
  }
  final String? processEncoding = jsonConvert.convert<String>(json['processEncoding']);
  if (processEncoding != null) {
    emergencyTaskProcessNodesEntity.processEncoding = processEncoding;
  }
  final String? rejectNodeId = jsonConvert.convert<String>(json['rejectNodeId']);
  if (rejectNodeId != null) {
    emergencyTaskProcessNodesEntity.rejectNodeId = rejectNodeId;
  }
  final String? subordinateCirculationAttribute = jsonConvert.convert<String>(json['subordinateCirculationAttribute']);
  if (subordinateCirculationAttribute != null) {
    emergencyTaskProcessNodesEntity.subordinateCirculationAttribute = subordinateCirculationAttribute;
  }
  final String? systemFormId = jsonConvert.convert<String>(json['systemFormId']);
  if (systemFormId != null) {
    emergencyTaskProcessNodesEntity.systemFormId = systemFormId;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyTaskProcessNodesEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyTaskProcessNodesEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyTaskProcessNodesEntity.updateDate = updateDate;
  }
  final int? warningLevel = jsonConvert.convert<int>(json['warningLevel']);
  if (warningLevel != null) {
    emergencyTaskProcessNodesEntity.warningLevel = warningLevel;
  }
  final String? webRoutingAddress = jsonConvert.convert<String>(json['webRoutingAddress']);
  if (webRoutingAddress != null) {
    emergencyTaskProcessNodesEntity.webRoutingAddress = webRoutingAddress;
  }
  final bool? isExpanded = jsonConvert.convert<bool>(json['isExpanded']);
  if (isExpanded != null) {
    emergencyTaskProcessNodesEntity.isExpanded = isExpanded;
  }
  final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
  if (isSelected != null) {
    emergencyTaskProcessNodesEntity.isSelected = isSelected;
  }
  return emergencyTaskProcessNodesEntity;
}

Map<String, dynamic> $EmergencyTaskProcessNodesEntityToJson(EmergencyTaskProcessNodesEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['appRoutingAddress'] = entity.appRoutingAddress;
  data['businessId'] = entity.businessId;
  data['childrenControlType'] = entity.childrenControlType;
  data['circulationAttribute'] = entity.circulationAttribute;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['disposalType'] = entity.disposalType;
  data['emergencyTaskInstructions'] = entity.emergencyTaskInstructions.map((v) => v.toJson()).toList();
  data['formId'] = entity.formId;
  data['iconAddress'] = entity.iconAddress;
  data['id'] = entity.id;
  data['nodeDescription'] = entity.nodeDescription;
  data['nodeId'] = entity.nodeId;
  data['nodeName'] = entity.nodeName;
  data['nodeNumber'] = entity.nodeNumber;
  data['nodeType'] = entity.nodeType;
  data['parentControlType'] = entity.parentControlType;
  data['pid'] = entity.pid;
  data['processEncoding'] = entity.processEncoding;
  data['rejectNodeId'] = entity.rejectNodeId;
  data['subordinateCirculationAttribute'] = entity.subordinateCirculationAttribute;
  data['systemFormId'] = entity.systemFormId;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['warningLevel'] = entity.warningLevel;
  data['webRoutingAddress'] = entity.webRoutingAddress;
  data['isExpanded'] = entity.isExpanded;
  data['isSelected'] = entity.isSelected;
  return data;
}

extension EmergencyTaskProcessNodesEntityExtension on EmergencyTaskProcessNodesEntity {
  EmergencyTaskProcessNodesEntity copyWith({
    String? appRoutingAddress,
    String? businessId,
    int? childrenControlType,
    String? circulationAttribute,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    int? disposalType,
    List<EmergencyTaskInstructionsEntity>? emergencyTaskInstructions,
    String? formId,
    String? iconAddress,
    String? id,
    String? nodeDescription,
    String? nodeId,
    String? nodeName,
    String? nodeNumber,
    int? nodeType,
    int? parentControlType,
    String? pid,
    String? processEncoding,
    String? rejectNodeId,
    String? subordinateCirculationAttribute,
    String? systemFormId,
    String? updateBy,
    String? updateById,
    String? updateDate,
    int? warningLevel,
    String? webRoutingAddress,
    bool? isExpanded,
    bool? isSelected,
  }) {
    return EmergencyTaskProcessNodesEntity()
      ..appRoutingAddress = appRoutingAddress ?? this.appRoutingAddress
      ..businessId = businessId ?? this.businessId
      ..childrenControlType = childrenControlType ?? this.childrenControlType
      ..circulationAttribute = circulationAttribute ?? this.circulationAttribute
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..disposalType = disposalType ?? this.disposalType
      ..emergencyTaskInstructions = emergencyTaskInstructions ?? this.emergencyTaskInstructions
      ..formId = formId ?? this.formId
      ..iconAddress = iconAddress ?? this.iconAddress
      ..id = id ?? this.id
      ..nodeDescription = nodeDescription ?? this.nodeDescription
      ..nodeId = nodeId ?? this.nodeId
      ..nodeName = nodeName ?? this.nodeName
      ..nodeNumber = nodeNumber ?? this.nodeNumber
      ..nodeType = nodeType ?? this.nodeType
      ..parentControlType = parentControlType ?? this.parentControlType
      ..pid = pid ?? this.pid
      ..processEncoding = processEncoding ?? this.processEncoding
      ..rejectNodeId = rejectNodeId ?? this.rejectNodeId
      ..subordinateCirculationAttribute = subordinateCirculationAttribute ?? this.subordinateCirculationAttribute
      ..systemFormId = systemFormId ?? this.systemFormId
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..warningLevel = warningLevel ?? this.warningLevel
      ..webRoutingAddress = webRoutingAddress ?? this.webRoutingAddress
      ..isExpanded = isExpanded ?? this.isExpanded
      ..isSelected = isSelected ?? this.isSelected;
  }
}
